package cc.wsyw126.java.test;

import java.util.*;

/**
 * Created by junpeng.yang on 16/10/13.
 */
public class test {
    public static void main(String[] args) {
        test test = new test();
        Set<Integer> set = test.getAllSubBuIdListByUser(12);

        set.addAll(test.getInteger());
        for (Integer integer : set) {
            System.out.println("integer = " + integer);
        }
    }

    public Set<Integer> getAllSubBuIdListByUser(int id) {
        Set<Integer> allBuIdSet = new HashSet<>();

        Set<Integer> buIdSet = new HashSet<>(allBuIdSet);

        allBuIdSet.addAll(Arrays.asList(1, 2, 3, 4, 5, 6));

        getInteger(allBuIdSet);

        return allBuIdSet;
    }

    private void getInteger(Set<Integer> allBuIdSet) {
        List<Integer> businessUnitModelList = Arrays.asList(12, 45, 546, 34);
        businessUnitModelList.stream().forEach(o -> {
            allBuIdSet.add(o);
        });
    }

    private Set<Integer> getInteger() {
        Set<Integer> allBuIdSet = new HashSet<>();
        List<Integer> businessUnitModelList = Arrays.asList(123, 456);
        businessUnitModelList.stream().forEach(o -> {
            allBuIdSet.add(o);
        });
        return allBuIdSet;
    }
}
